From 7b19c504459e2368ceb42540691abf664db935c6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 20 Nov 2023 22:50:04 +0000 Subject: Support capture of vars in effect handler methods --- ...mpiler.testing.snapshots.Snapshotter)].expected | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected') diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..2ef7f02e --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,63 @@ +Compilation unit elements: + +( + function + "shed__function__f__0" + visibility=private + locals=((param "closurePointer__0" data-ptr) (val "local__a" data-ptr) (val "local__b" data-ptr)) + return-type=int + body=( + ( + memory-load + (local "local__a") + pointer=(local "closurePointer__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 0) + ) + ( + memory-load + (local "local__b") + pointer=(local "closurePointer__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 1) + ) + (return (local "local__a")) + ) +) + +Locals: + * (val "local__a" data-ptr) + * (val "local__b" data-ptr) + * (val "closure__f__0" int) + * (val "closurePointer__f__0" data-ptr) + +Instructions: + +( + (alloc-heap (local "closurePointer__f__0") (struct (function-ptr (struct (data-ptr data-ptr))))) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(0) + value=(function-ptr "shed__function__f__0") + ) + (data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0")) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 0) + value=(local "local__a") + ) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct (function-ptr (struct (data-ptr data-ptr)))) + offset=(1 1) + value=(local "local__b") + ) +) + +Temporary stack: + * closure__f__0 -- cgit v1.2.3